// web/src/app/api/(forum)/comments/one/[id]/route.ts

import {NextRequest, NextResponse} from "next/server";
import {db} from "@/lib/db";

export async function DELETE(req:NextRequest){
    try {
        let url = req.url
        let id = (url.slice(
            url.lastIndexOf('/') + 1
        ))

        const res = await db.comment.delete({
            where: {
                id
            }
        })

        return NextResponse.json({res})
    } catch (err) {
        return NextResponse.json({err})
    }
}